#pragma once

#include <QtWidgets/QWidget>
#include "ui_DirectShowDemo.h"
#include "camera.hpp"
#include "TextureUpdater.h"
#include <QImage>
class DirectShowDemo : public QWidget
{
    Q_OBJECT

public:
    DirectShowDemo(QWidget *parent = nullptr);
    ~DirectShowDemo();

	void GetFrame(Camera *camera, BYTE *buff, LONG len);

	BOOL SaveBitmap(BYTE *pBuffer, long lBufferSize);
public slots:
	void OnImageUpdate(QImage img);

private:
    Ui::DirectShowDemoClass ui;
	CTextureUpdater *m_textureUpdater = nullptr;
	bool m_isOpened = false;
	Camera* m_camera = nullptr;
};
